<?php

class Flow_Urls {

    public static function base_url() {
        $apf = APF::get_instance();
        $base_domain = $apf->get_config("base_domain");
        $url = 'http://' . $base_domain . '/';
        return $url;
    }
    //新建档案
    public static function add_user($uid=""){
        if($uid){
            return self::base_url().'flow/AddUser/?id='.$uid;
        }
        return self::base_url().'flow/AddUser/';
    }
    //入职流程
    public static function add_staff($uid=""){
        if($uid){
            return self::base_url().'flow/AddStaff/?id='.$uid;
        }
        return self::base_url().'flow/AddStaff/';
    }
    //申请离职
    public static function apply_retire(){
        return self::base_url().'flow/ApplyRetire/';
    }
    //申请异动
    public static function apply_transfer($flow_id=0){
        $url= self::base_url().'flow/ApplyTransfer/';
        if($flow_id){
            $url .= '?flow_id='.$flow_id;
        }
        return $url;
    }
    //离职流程
    public static function dimission(){
        return self::base_url().'flow/Dimission/';
    }
    //待办事项
    public static function flow_list(){
        return self::base_url().'flow/';
    }
    //员工安全key
    public static function flow_list_key() {
        return self::base_url().'flow/key/';
    }
    //已处理事项
    public static function flow_done_list(){
        return self::base_url().'flow/?do=process';
    }
    //流程监控
    public static function flow_all_list(){
        return self::base_url().'flow/?do=all';
    }
    //角色设置
    public static function flow_role(){
        return self::base_url().'flow/role/';
    }
    //辞退
    public static function to_dimiss(){
        return self::base_url().'flow/ToDimiss/';
    }
    //异动流程
    public static function transfer(){
        return self::base_url().'flow/transfer/';
    }
    //打印
    public static function flow_print(){
        return self::base_url().'flow/print/';
    }
    //it导出
    public static function flow_output(){
        return self::base_url().'flow/Output/';
    }
    //批量处理
    public static function flow_dolist(){
        return self::base_url().'flow/DoList/';
    }
    //申请招聘
    public static function flow_apply_recruit(){
        return self::base_url().'flow/ApplyRecruit/';
    }
    //招聘
    public static function flow_recruitment($flow_id=""){
        if($flow_id){
            return self::base_url().'flow/Recruitment/?id='.$flow_id;
        }
        return self::base_url().'flow/Recruitment/';
    }
    /*ajax*/
    /**
     * 员工搜索在hroa系统的ajax
     */
    public static function ajax_search_user(){
        return self::base_url().'hr/ajax/SearchUser/';
    }
    /**
     * 职位搜索在hroa系统的ajax
     */
    public static function ajax_search_job(){
        return self::base_url().'hr/ajax/SearchJob/';
    }
    /**
     * 基本信息
     */
    public static function ajax_search_userinfo(){
        return self::base_url().'ajax/SearchUserInfo/';
    }
    /**
     * 增加和删除员工角色
     */
    public static function ajax_update_role(){
        return self::base_url().'ajax/UpdateRole/';
    }
    /**
     *
     */
    public static function ajax_flow_count(){
        return self::base_url().'ajax/GetFlowCount/';
    }
    /**
     * 得到审批中的职位信息
     * @return string
     */
    public static function ajax_flow_job(){
        return self::base_url().'ajax/GetApplyJob/';
    }
    /**
     * 提示页面跳转链接
     * @params array URL后面参数
     */
    public static function build_jump_url($params){
        return self::base_url().'error/ShowTips/'.$params;
    }

    public static function build_multi_print(){
        return self::base_url().'flow/MultiPrint/';
    }
    //转正
    public static function flow_regular($flow_id=0){
        $url =  self::base_url().'flow/regular/';
        if($flow_id){
            $url .= "?flow_id=".$flow_id;
        }
        return $url;
    }
    //续签
    public static function flow_renew($flow_id=0){
        $url =  self::base_url().'flow/renew/';
        if($flow_id){
            $url .= "?flow_id=".$flow_id;
        }
        return $url;
    }
}